package com.verisette.ncos.service.accesscontrol.bizunit;

import org.apache.log4j.Logger;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import org.corp.agi.common.exception.ProcessException;
import org.corp.agi.service.bean.ProcessContext;
import org.corp.agi.service.bizunit.CommonBusinessUnit;
import com.verisette.ncos.persistence.domain.MasterUserProfile;

/**
 * {Description here}
 *
 * @author Thippawan Muangchu (Tip)
 * @since Oct 1, 2010 3:59:31 PM
 * @version 1.0.0
 * @see 
 */
@Transactional(propagation=Propagation.REQUIRES_NEW)
public class UpdateAccessLogBU  extends CommonBusinessUnit {
	
	private Logger logger = Logger.getLogger(UpdateAccessLogBU.class);

	@Override
	public void execute(ProcessContext processContext) throws ProcessException {
		
		MasterUserProfile authenUser = (MasterUserProfile) processContext.getValueObject();
		
		authenUser.setUspWrongLoginCounter( (short) (authenUser.getUspWrongLoginCounter()+1) );
		commonDAO.update(authenUser);
		
	}

}
